<!--河南星辰软件科技有限公司
@copyright Copyright (c) 2010~2022 All rights reserved.
-->
<template>
  <div class='app-container'>
    <el-form ref="form" :model="s_search" :rules="rules" label-width="100px" id="mvcfm">
      <div class="form-unit">
        <span class="mvc-title-left"> 搜索 </span>
      </div>
      <div>
        <el-row>
          <el-col :span="12">
            <el-form-item label="类型" prop="hours_type">
              <el-select style='width:100%' v-model="s_search.hours_type">
                <el-option label="－－无－－" value='' />
                <el-option v-for="dict in s_tockset" :key="dict.__code" :label="dict.__desc" :value="dict.__code"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="仓库名称" prop="hours_name">
              <el-input v-model="s_search.hours_name" />
            </el-form-item>
          </el-col>
        </el-row>
      </div>
      <el-button @click="('')" type='success' size="mini"><i class='fa fa-check'></i>搜索</el-button>
      <el-button @click="gotoPage('/psi/supplychainmana/WarehouseChoice?'+vueparams+'')" type='primary' size="mini">重置</el-button>
      <div class="form-unit">
        <span class="mvc-title-left"> 仓库列表 </span>
      </div>
      <el-table :data="s_hours">
        <el-table-column label="" prop="hours_id" width="80">
          <template slot-scope="scope">
            <el-button @click="$parent.$parent.closeWarehouseChoice(scope.row['hours_id'],scope.row['hours_name']);" type="success" size="mini"><i class="fa fa-edit"></i>选择</el-button>
          </template>
        </el-table-column>
        <el-table-column label="仓库编号" prop="hours_num">
        </el-table-column>
        <el-table-column label="仓库名称" prop="hours_name">
        </el-table-column>
        <el-table-column label="仓库类型" prop="description">
        </el-table-column>
        <el-table-column label="仓库条形码" prop="hours_barcode">
        </el-table-column>
        <el-table-column label="管理员" prop="contact_name">
        </el-table-column>
      </el-table>
      <pagination v-show="total>0" :total="total" :limit.sync="pageSize" @pagination="getPage" />
    </el-form>
  </div>
</template>
<script>
  import request from '@/utils/request'
  export default {
    name: 'WarehouseChoice',
    components: {},
    props: ['popparams'],
    data() {
      return {
        vueparams: this.getVUEParams(""),
        s_search: {
          hours_type: null,
          hours_name: null,
        },
        s_hours: [],
        s_tockset: [],
        loading: false,
        rules: {}
      }
    },
    created() {
      this.getData();
    },
    updated() {},
    mounted() {},
    methods: {
      getData() {
        request({
          method: 'get',
          url: '/xcapi/VUEAction/psi/supplychainmana/StorageAction/warehouseChoice?' + this.vueparams,
        }).then(data => {
          for (var k in data) {
            if (Array.isArray(data[k])) {
              this[k] = data[k];
            } else {
              $.extend(this[k], data[k]);
            }
          }
        })
      },
    },
  }
</script>
